<?php
include('global.php');         
                      
// setup controller
$frontController = Zend_Controller_Front::getInstance();
$frontController->throwExceptions(true);
$frontController->setControllerDirectory('application/controllers');

// setup layout path
$layout=Zend_Layout::startMvc($configLayout);

// set suffix for layout
$layout->setViewSuffix('php') ;
$request=new Zend_Controller_Request_Http();
$request->setBaseUrl($appSetting->test->baseurl);
$request->setPathInfo(substr($request->getRequestUri(),strlen($request->getBaseUrl())));
            
// set suffix for template
$viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer();
$viewRenderer->setView(new Zend_View())->setViewSuffix('php');
Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);

// run!
$frontController->dispatch($request);